"use strict";

exports.__esModule = true;
exports.rndpickarr = rndpickarr;
function getRandInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min;
}

function rndpickarr(arr) {
    var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;

    var s = arr;
    var keys = arr.map(function (v, k) {
        return k;
    });
    var ret = [];
    for (var i = 0; i < length; i++) {
        var pickindex = getRandInt(0, keys.length);
        ret.push(keys[pickindex]);
        keys.splice(pickindex, 1);
    }
    return ret;
}